'use strict'

describe 'Service: session', ->

  # load the service's module
  beforeEach module 'swarmApp'

  # instantiate service
  session = {}
  beforeEach inject (_session_) ->
    session = _session_

  it 'should do something', ->
    expect(!!session).toBe true

  it 'saves/loads', ->
    # tests are too quick, and I don't wanna bother with DI'ing date right now
    origsaved = session.state.date.saved = new Date session.state.date.saved.getTime() - 1
    state = session._saves()
    expect(origsaved).not.toEqual session.state.date.saved

    # session is nonequal because of its class/ctor, so use an object for later compares
    orig = _.clone session.state
    loaded = session._loads state
    expect(orig.date.loaded).not.toEqual loaded.date.loaded
    delete orig.date.loaded
    delete loaded.date.loaded
    expect(orig).toEqual loaded

  it 'saves/loads versionless', ->
    encoded = session._saves()
    [version, encoded] = session._splitVersionHeader encoded
    expect(encoded.indexOf '|').toBeLessThan 0
    data = session._loads encoded
    expect(!!data).toBe true

  it 'saves/loads versionful', ->
    encoded = session._saves()
    expect(encoded.indexOf '|').not.toBeLessThan 0
    data = session._loads encoded
    expect(!!data).toBe true

  it 'validates the save version programmatically', ->
    expect(-> session._validateSaveVersion '0.1.0', '0.1.0').not.toThrow()
    expect(-> session._validateSaveVersion '0.1.0', '0.1.30').not.toThrow()
    # we're allowing older version imports
    expect(-> session._validateSaveVersion '0.1.30', '0.1.0').not.toThrow()
    # but beta minor versions are a reset
    expect(-> session._validateSaveVersion '0.1.30', '0.2.0').toThrow()
    expect(-> session._validateSaveVersion '0.2.30', '0.3.0').toThrow()
    # no importing 0.2.0 games into 0.1.0 either
    expect(-> session._validateSaveVersion '0.2.0', '0.1.30').toThrow()
    expect(-> session._validateSaveVersion '0.3.0', '0.2.30').toThrow()

    expect(-> session._validateSaveVersion '0.2.30', '0.2.0').not.toThrow()
    expect(-> session._validateSaveVersion '0.2.0', '0.2.0').not.toThrow()
    expect(-> session._validateSaveVersion '1.0.0', '1.0.0').not.toThrow()
    # 0.x to 1.0 is not a reset, but no reverse-imports, and 0.1.x's still blacklisted
    expect(-> session._validateSaveVersion '0.9.0', '1.0.0').not.toThrow()
    expect(-> session._validateSaveVersion '1.0.0', '0.9.0').toThrow()
    expect(-> session._validateSaveVersion '0.1.0', '1.0.0').toThrow()
    expect(-> session._validateSaveVersion '1.9.0', '1.0.0').not.toThrow()
    expect(-> session._validateSaveVersion '1.0.0', '1.9.0').not.toThrow()
    # major versions after 1.0 aren't resets
    expect(-> session._validateSaveVersion '2.0.0', '1.0.0').not.toThrow()
    expect(-> session._validateSaveVersion '1.0.0', '2.0.0').not.toThrow()
    # default version - very old saves.
    expect(-> session._validateSaveVersion undefined, '0.1.0').not.toThrow()
    expect(-> session._validateSaveVersion undefined, '0.2.0').toThrow()
    # current-version based. Breaks when upgrading versions.
    expect(-> session._validateSaveVersion '0.1.0').toThrow()
    expect(-> session._validateSaveVersion '0.2.0').not.toThrow()
    expect(-> session._validateSaveVersion '1.0.0').not.toThrow()
    expect(-> session._validateSaveVersion undefined).toThrow()
    expect(-> session._validateSaveVersion '1.0.0-publictest1').toThrow()
    expect(-> session._validateSaveVersion '1.0.0-publictest8').toThrow()
    expect(-> session._validateSaveVersion '1.0.0-publictest20').toThrow()

  it 'validates the save version on import', inject (version) ->
    session.state.version.started = '0.0.1'
    encoded = session._saves()
    expect(-> session._loads encoded).toThrow()
    session.state.version.started = '1.0.0'
    encoded = session._saves()
    expect(-> session._loads encoded).not.toThrow()
    session.state.version.started = version
    encoded = session._saves()
    expect(-> session._loads encoded).not.toThrow()
    # missing version is assumed to be 0.1.0, but we're past 0.2.0 now
    delete session.state.version
    encoded = session._saves()
    expect(-> session._loads encoded).toThrow()

  it 'validates the format version on import, blocking all publictest imports', inject (version) ->
    v02 = 'MC4yLjIy|Q2hlYXRlciA6KAoKN4IglgJiBcIG4AYB0AmEAaEALApgQwCcAXAI3yIEkpZFVpdDTyMQBXAOzCKIE8AHHAGcYoMOzhhBYEgBscWPEQDGuAjxggAjCwC2zWCgCsAZhSmkhgOzbMMwnDwbNAFgCcbpADZDzlkoD2Af7sGggsRDgEBFz+aqEsOOyRAObqsGGYBEIC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lH01Zwao9+LikKHB5isyQBUVlzNHZxMB8bLYSwhvCyjFciXBpKSxG6FDEQo1eEWFBuFFIZQ/0JGhMDAiogEhGgARKZFGi0FSyeQEeoskKHadx8lHV5DKCVGolugOoplIUMKBkYNMRHbpOcKHYhDfyiyD4QeS2JdBdQLxVkX+ySj3F6EjXesDUKtJSkP6Dov8LHUAKpBihVYl0MUn+hxddoThK0VJCmGIgQgewZ5mSkbERgiRBwR4opHAqZh0eVIg4JsCtJOx3RlUf6OuLi4DBUKjKFNCBTcyDVLKTnekfCC0oSkR6cw2YPSOvxDxIsI9ZcTmDZH48ugT4MSvKilSCjYy4mbwJULuhTJ7x6QM/KkAJHoBzI9Im3O0D8ALldIr7JoNBIPBk53qrkEEdBNtAHgugP/XURSOoD0jMBvoJYcaOyR1hAxGQI2p+IvIvjckFEsjvSy/FU9Zx9OU0CaFsC/kFeSo4XnWTgwvwIUgYsst4BGpMN2x+aenOaDdJcgJUtpHpII1tAuBYwzmHAecIUm/FHxKkmoTbwEjwTwAMyWgLHUeykgbcmQGdI6OaHARPcwkMyc2U8a4EsMeQGyU6LsmOAHJnEwSrHTyBmgnwGGFSVuC2DRiI6Ug+AWCMALx48gqFBXs2Fep1UuqW0HAeMBiluBCCT+ZgWCOIFmhIeB1Y6KdFDpgj6BhYQ0glP+jogh4yjA8swJhEjUb815HAd4FepiDoCIzMSURHarZ4DKzAkqcFSGCo5PiagpERsDjzx4wh70MERtXsCIhRiagkqWhg+CEELyt6R0f+EaxbFPBF5ctK9TGxohFIfgEaX9E2m8dEi7GOiFBhxT5QAAsmABQBoARK9xacJRKsCAjDut0UOiBndi0Bx41UJsE2Azb2wgAAAA='
    expect(->session._loads v02).not.toThrow()
    expect(->session._loads v1).not.toThrow()
    expect(->session._loads publictestCreated).toThrow()
    expect(->session._loads publictestImported).toThrow()
    expect(->session._loads publictestBroken).toThrow()

  it 'ignores whitespace', inject (version) ->
    # this example from https://www.reddit.com/r/swarmsim/comments/3352iu/save_file_doesnt_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